package com.k7.mobile.platform.bo.impl;

import java.util.List;

import com.k7.mobile.platform.bo.ISearchBO;
import com.k7.mobile.platform.dao.ISearchDAO;
import com.k7.mobile.platform.dataobject.SearchDO;
import com.k7.mobile.platform.exception.BOException;

public class SearchBOImpl extends BaseBOImpl implements ISearchBO{
	
	private ISearchDAO searchDAO;

	public void setSearchDAO(ISearchDAO searchDAO) {
		this.searchDAO = searchDAO;
	}

	public Long add(SearchDO searchDO) throws BOException {
		try{ 
			Long id=searchDAO.add(searchDO);
			return id;
		}catch(Exception ex){
			log.error("SearchBOImpl:add,插入Search失败", ex);
			throw new BOException("创建禁止Search失败", ex);
		}
	}

	@Override
	public void delete(SearchDO searchDO) throws BOException {
		try{
			searchDAO.delete(searchDO);
		}catch(Exception ex){
			log.error("SearchBOImpl:delete,删除Search失败", ex);
			throw new BOException("删除Search失败", ex);
		}
		
	}
	@Override
	public void update(SearchDO searchDO) throws BOException {
		try{
			searchDAO.update(searchDO);
		}catch(Exception ex){
			log.error("SearchBOImpl:delete,更新Search失败", ex);
			throw new BOException("更新Search失败", ex);
		}
		
	}

	@Override
	public List<SearchDO> findList(SearchDO searchDO) throws BOException {
		try{
			List<SearchDO> list = searchDAO.findList(searchDO);
			return list;
		}catch(Exception ex){
			log.error("SearchBOImpl:findBarDO,批量获取Search信息出错", ex);
			throw new BOException("批量获取Search信息出错", ex);
		}
		
	}

	@Override
	public SearchDO getSearch(SearchDO searchDO) throws BOException {
		try{

			SearchDO returnDO = searchDAO.getSearch(searchDO);

			return returnDO;
		}catch(Exception ex){
			log.error("SearchBOImpl:getSearch,获取Search信息出错", ex);
			throw new BOException("获取Search信息出错", ex);
		}
	}
}
